﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

namespace ChessGameV2.Scenes
{
    public static class Sounds
    {
        public static bool isSoundEffect
        {
            get
            {
                return Config.Config.isSoundEffect;
            }
            set
            {
                Config.Config.isSoundEffect = value;
            }
        }
        public static bool isSoundBackground
        {
            get
            {
                return Config.Config.isSoundBackground;
            }
            set
            {
                Config.Config.isSoundBackground = value;
            }
        }

        private static SoundEffect MoveSound;
        private static SoundEffect newGame;
        private static SoundEffect click;
        private static SoundEffect gameover;
        private static SoundEffect captureMove;
        private static SoundEffect check;
        private static SoundEffect timeless;
        private static Song BgSound;

        public static void LoadContent(ContentManager Content)
        {
            MoveSound = Content.Load<SoundEffect>("Sounds/normal_move");
            newGame = Content.Load<SoundEffect>("Sounds/NewGame");
            click = Content.Load<SoundEffect>("Sounds/click");
            gameover = Content.Load<SoundEffect>("Sounds/game_over");
            captureMove = Content.Load<SoundEffect>("Sounds/capture_move");
            check = Content.Load<SoundEffect>("Sounds/check");
            timeless = Content.Load<SoundEffect>("Sounds/click");

            BgSound = Content.Load<Song>("Sounds/background");
        }
        public static void Click()
        {
            if (isSoundEffect) click.Play();
        }
        public static void Timeless()
        {
            if (isSoundEffect) timeless.Play();
        }
        public static void Gameover()
        {
            if (isSoundEffect) gameover.Play();
        }
        public static void CaptureMove()
        {
            if (isSoundEffect) captureMove.Play();
        }
        public static void Check()
        {
            if (isSoundEffect) check.Play();
        }
        public static void Move()
        {
            if (isSoundEffect) MoveSound.Play();
        }
        public static void NewGame()
        {
            if (isSoundEffect) newGame.Play();
        }
    }
}
